﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Security;
using Microhard.Permission.MVCFilter;
using Microhard.Permission.Models;
using Microhard.Core.DBUtility;

namespace Microhard.Permission.Extension
{
    public static class HtmlHelperExt
    {
        public static User GetCurrentUserInfoFromSession(this HtmlHelper value)
        {
            return MVCFilterAtrForLogon.GetLogonUser();
        }

        public static User GetCurrentUserInfoFromSessionByCtr(this Controller value)
        {
            return MVCFilterAtrForLogon.GetLogonUser();
        }

        public static ScopeResult GetCurrentUserScope(this HtmlHelper value)
        {
            return value.ViewData["scope"] as ScopeResult;
        }
    }
}
